Music Object Extension - Callbacks
|
|
Unlike the onLoad, onMetaEvent, onPause, onPlay, onReady, and onStop methods that provide the core Music Object API's callback support, these additional methods allow one to stack multiple event handlers for the same player event.
For example, while the onPlay method only allows one to override the currently registered handler for the play event, the addOnPlay method lets one add new handlers on top of currently registered handlers. Then, when a play event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnPlay method will be executed in the order in which they were added to the stack. In fact, callback handlers that are added for any callback type are executed when the callback event occurs, and in the order in which they were added to the stack of callback handlers. Consider the following code example...
myMusicObject.addOnPlay (initialiseUI);
myMusicObject.addOnPlay ('fileStarted = true');
myMusicObject.addOnPlay ('preloadNextSong ("creepy-swamp.rmf")');
|
Now, when a play event occurs for myMusicObject, the initialiseUI function will first be called, then the statement fileStarted = true will be evaluated, and then the statement preloadNextSong ("creepy-swamp.rmf") will be evaluated. Of course, in this very straightforward situation one could simply have rolled all the actions into a single myOnPlayHandler function and registered this using the onPlay method, but the goal of the methods in this extension is to allow multiple code modules to add to the callback handler stack for any given callback type, without needing to worry about handlers that have already been registered by other code modules.
One of the things that this allows is for multiple code segments to cooperatively listen for events that occur within a shared Music Object instance, without these code modules having to have an intimate understanding of each other's internal implementation. Using the methods for managing callbacks that are provided in this extension, different code modules can use the callbacks for a Music Object instance without overriding each other's registered callback handlers, as would otherwise occur with the core Music Object callback methods.
Tip on Removing Callbacks
If a function, rather than a statement block, has been registered as a callback handler, then that callback handler can only be removed by specifying the original function that was registered as the callback handler, and not a statement block representing a call to the function. For instance, the following code will not work correctly...
function myOnPlayHandler () {
// code to handle onPlay event
}
myMusicObject.addOnPlay (myOnPlayHandler);
myMusicObject.removeOnPlay ('myOnPlayHandler ()');
|
However, the code listed below is correct and the handler registered using the addOnPlay method is successfully removed using the removeOnPlay method.
function myOnPlayHandler () {
// code to handle onPlay event
}
myMusicObject.addOnPlay (myOnPlayHandler);
myMusicObject.removeOnPlay (myOnPlayHandler);
|
|
What's New in the Latest Version
|
There is a dedicated version history for this extension, where you will be able to find out about the new features and possible issues with the most recent version. The version history for this extension is independent of the version history for the core Music Object API.
To get the "music-object-x-callbacks.js" JavaScript file that implements this extension, simply right-click on this link (click-and-hold for Mac users). Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the file as "music-object-x-callbacks.js" into an appropriate folder of the local copy of your Web site.
In case you have problems saving the file using the above link, the "music-object-x-callbacks.js" file can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.
In order to use this extension, the following JavaScript file(s) must first be sourced in...
- music-object.js (version 3.3.0 or higher)
For more information on using extensions, consult the section About Music Object Extensions.
The instance methods provided in this module are listed in the table below and are divided into three groups: Adding Event Handlers, Clearing Event Handlers, and Removing Event Handlers. Removing event handlers is different to clearing event handlers, in that one can remove very specific handlers that have been registered, whereas clearing will clear all event handlers that have been registered. In a few cases there are exceptions to this rule, and you should refer to the method explanations and notes for further details.
| Name |
Short Description |
| Adding Event Handlers |
| addMetaEventHandler |
Adds an event handler for a specific meta event type and value pair. |
| addOnAudibleStateChange |
Adds an event handler to a Music Object instance's list of audible state change event handlers. |
| addOnLoad |
Adds an event handler to a Music Object instance's list of load event handlers. |
| addOnMetaEvent |
Adds an event handler to a Music Object instance's list of meta event handlers. |
| addOnOutputVolumeChange |
Adds an event handler to a Music Object instance's list of output volume change event handlers. |
| addOnPause |
Adds an event handler to a Music Object instance's list of pause event handlers. |
| addOnPlay |
Adds an event handler to a Music Object instance's list of play event handlers. |
| addOnReady |
Adds an event handler to a Music Object instance's list of ready event handlers. |
| addOnStop |
Adds an event handler to a Music Object instance's list of stop event handlers. |
| Clearing Event Handlers |
| clearCallbacks |
Clears all callbacks that have been assigned to a Music Object instance. |
| clearOnAudibleStateChange |
Clears all handlers assigned to the audible state change event of a Music Object instance. |
| clearOnLoad |
Clears all handlers assigned to the load event of a Music Object instance. |
| clearOnMetaEvent |
Clears all handlers assigned to the meta event of a Music Object instance. |
| clearOnOutputVolumeChange |
Clears all handlers assigned to the output volume change event of a Music Object instance. |
| clearOnPause |
Clears all handlers assigned to the pause event of a Music Object instance. |
| clearOnPlay |
Clears all handlers assigned to the play event of a Music Object instance. |
| clearOnReady |
Clears all handlers assigned to the ready event of a Music Object instance. |
| clearOnStop |
Clears all handlers assigned to the stop event of a Music Object instance. |
| Removing Event Handlers |
| removeCallbackHandlers |
Removes the specified callback handler (or handlers) from the specified instance callback type (or types). |
| Music.removeCallbackHandlers |
Removes the specified callback handler (or handlers) from the specified static callback type (or types). |
| removeMetaEventHandlers |
Removes one or more handlers for specific meta event type and value pairs. |
| removeOnAudibleStateChange |
Removes a specified handler from a Music Object instance's list of audible state change event handlers. |
| removeOnLoad |
Removes a specified handler from a Music Object instance's list of load event handlers. |
| removeOnMetaEvent |
Removes a specified handler from a Music Object instance's list of meta event handlers. |
| removeOnOutputVolumeChange |
Removes a specified handler from a Music Object instance's list of output volume change event handlers. |
| removeOnPause |
Removes a specified handler from a Music Object instance's list of pause event handlers. |
| removeOnPlay |
Removes a specified handler from a Music Object instance's list of play event handlers. |
| removeOnReady |
Removes a specified handler from a Music Object instance's list of ready event handlers. |
| removeOnStop |
Removes a specified handler from a Music Object instance's list of stop event handlers. |
|
|
The addMetaEventHandler instance method lets one add event handlers for specific meta events that are encountered within an RMF or MIDI file.
Unique meta events are identified by their meta event type and meta event value, as specified by the MetaEventTypeSTR and MetaEventValueSTR parameters, respectively. So, rather than registering a generalized handler using the onMetaEvent or addOnMetaEvent methods and then writing your own code for the handler to detect specific meta events that you care about, you can instead let this extension do some of this hard work for you by registering handlers for the specific events that you care about.
For instance, if you wanted to be notified each time an RMF composition reached the beginning of a fade out at the end of the composition, and assuming that the composition contains a marker meta event at the start of this fade out, then one could use the following code to register the handler for this unique meta event...
function musicFadeOutBegins () {
// code to change UI to reflect fade out
}
myMusicObject.addMetaEventHandler ('Marker','Fade to end',musicFadeOutBegins);
|


The addOnAudibleStateChange instance method lets you add an event handler to a Music Object instance's list of audible state change event handlers.
|
addOnAudibleStateChange ( HandlerFunction ) |
The addOnAudibleStateChange method is similar to the onAudibleStateChange method in that it lets you register handlers for the audible state change event of a Music Object instance. The key difference is that, while the onAudibleStateChange method only lets you register one handler for the audible state change event and overrides any existing registered handler, the addOnAudibleStateChange method instead lets you add to a stack of event handlers for the audible state change event. When an audible state change event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnAudibleStateChange method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the audible state change event using this method do not override a handler registered using the core Music Object API's onAudibleStateChange method. Any handler registered for the audible state change event using the onAudibleStateChange method is executed before any handlers that have been added to the handler stack using the addOnAudibleStateChange method.


The addOnLoad instance method lets you add an event handler to a Music Object instance's list of load event handlers.
The addOnLoad method is similar to the onLoad method in that it lets you register handlers for the load event of a Music Object instance. The key difference is that, while the onLoad method only lets you register one handler for the load event and overrides any existing registered handler, the addOnLoad method instead lets you add to a stack of event handlers for the load event. When a load event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnLoad method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the load event using this method do not override a handler registered using the core Music Object API's onLoad method. Any handler registered for the load event using the onLoad method is executed before any handlers that have been added to the handler stack using the addOnLoad method.


The addOnMetaEvent instance method lets you add an event handler to a Music Object instance's list of meta event handlers.
The addOnMetaEvent method is similar to the onMetaEvent method in that it lets you register handlers for the meta event of a Music Object instance. The key difference is that, while the onMetaEvent method only lets you register one handler for the meta event and overrides any existing registered handler, the addOnMetaEvent method instead lets you add to a stack of event handlers for the meta event. When a meta event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnMetaEvent method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the meta event using this method do not override a handler registered using the core Music Object API's onMetaEvent method. Any handler registered for the meta event using the onMetaEvent method is executed before any handlers that have been added to the handler stack using the addOnMetaEvent method.

The addOnOutputVolumeChange instance method lets you add an event handler to a Music Object instance's list of output volume change event handlers.
|
addOnOutputVolumeChange ( HandlerFunction ) |
The addOnOutputVolumeChange method is similar to the onOutputVolumeChange method in that it lets you register handlers for the output volume change event of a Music Object instance. The key difference is that, while the onOutputVolumeChange method only lets you register one handler for the output volume change event and overrides any existing registered handler, the addOnOutputVolumeChange method instead lets you add to a stack of event handlers for the output volume change event. When an output volume change event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnOutputVolumeChange method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the output volume change event using this method do not override a handler registered using the core Music Object API's onOutputVolumeChange method. Any handler registered for the output volume change event using the onOutputVolumeChange method is executed before any handlers that have been added to the handler stack using the addOnOutputVolumeChange method.


The addOnPause instance method lets you add an event handler to a Music Object instance's list of pause event handlers.
The addOnPause method is similar to the onPause method in that it lets you register handlers for the pause event of a Music Object instance. The key difference is that, while the onPause method only lets you register one handler for the pause event and overrides any existing registered handler, the addOnPause method instead lets you add to a stack of event handlers for the pause event. When a pause event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnPause method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the pause event using this method do not override a handler registered using the core Music Object API's onPause method. Any handler registered for the pause event using the onPause method is executed before any handlers that have been added to the handler stack using the addOnPause method.


The addOnPlay instance method lets you add an event handler to a Music Object instance's list of play event handlers.
The addOnPlay method is similar to the onPlay method in that it lets you register handlers for the play event of a Music Object instance. The key difference is that, while the onPlay method only lets you register one handler for the play event and overrides any existing registered handler, the addOnPlay method instead lets you add to a stack of event handlers for the play event. When a play event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnPlay method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the play event using this method do not override a handler registered using the core Music Object API's onPlay method. Any handler registered for the play event using the onPlay method is executed before any handlers that have been added to the handler stack using the addOnPlay method.


The addOnReady instance method lets you add an event handler to a Music Object instance's list of ready event handlers.
The addOnReady method is similar to the onReady method in that it lets you register handlers for the ready event of a Music Object instance. The key difference is that, while the onReady method only lets you register one handler for the ready event and overrides any existing registered handler, the addOnReady method instead lets you add to a stack of event handlers for the ready event. When a ready event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnReady method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the ready event using this method do not override a handler registered using the core Music Object API's onReady method. Any handler registered for the ready event using the onReady method is executed before any handlers that have been added to the handler stack using the addOnReady method.


The addOnStop instance method lets you add an event handler to a Music Object instance's list of stop event handlers.
The addOnStop method is similar to the onStop method in that it lets you register handlers for the stop event of a Music Object instance. The key difference is that, while the onStop method only lets you register one handler for the stop event and overrides any existing registered handler, the addOnStop method instead lets you add to a stack of event handlers for the stop event. When a stop event occurs for a Music Object instance, all handlers that have been added to the stack using the addOnStop method will be executed in the order in which they were added to the stack.
For backward compatibility reasons, handlers registered for the stop event using this method do not override a handler registered using the core Music Object API's onStop method. Any handler registered for the stop event using the onStop method is executed before any handlers that have been added to the handler stack using the addOnStop method.


The clearCallbacks instance method lets you clear all callbacks that have been assigned to a Music Object instance.
|
clearCallbacks ( ) |
The clearCallbacks method clears all callbacks that have been registered for the Music Object instance. This includes callbacks registered using the core Music Object API's onLoad, onMetaEvent, onPause, onPlay, onReady, and onStop methods, as well as this extension's addMetaEventHandler, addOnLoad, addOnMetaEvent, addOnPause, addOnPlay, addOnReady, and addOnStop methods. If you do not wish to affect handlers registered using the core Music Object API's callback methods, then you should use the removeCallbackHandlers method.

The clearOnAudibleStateChange instance method lets you clear all handlers assigned to the audible state change event of a Music Object instance.
|
clearOnAudibleStateChange ( ) |
The clearOnAudibleStateChange method clears all handlers that have been added for the audible state change event using this extension's addOnAudibleStateChange method, as well as the core Music Object API's addCallbackHandler and onAudibleStateChange methods. To remove only those handlers that have been added using the addOnAudibleStateChange or addCallbackHandler methods, use the variation of the removeOnAudibleStateChange method that takes no parameters, as in the statement myMusicObject.removeOnAudibleStateChange ( ). It should be noted that using the statement onAudibleStateChange (null) to clear a handler that has been registered for the audible state change event using the onAudibleStateChange method has no effect on handlers that have been registered using the addOnAudibleStateChange or addCallbackHandler methods.

The clearOnLoad instance method lets you clear all handlers assigned to the load event of a Music Object instance.
|
clearOnLoad ( ) |
The clearOnLoad method clears all handlers that have been added for the load event using this extension's addOnLoad method, as well as the core Music Object API's addCallbackHandler and onLoad methods. To remove only those handlers that have been added using the addOnLoad or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onLoad (null) to clear a handler that has been registered for the load event using the onLoad method has no effect on handlers that have been registered using the addOnLoad or addCallbackHandler methods.

The clearOnMetaEvent instance method lets you clear all handlers assigned to the meta event of a Music Object instance.
|
clearOnMetaEvent ( ) |
The clearOnMetaEvent method clears all handlers that have been added for the meta event using this extension's addOnMetaEvent method, as well as the core Music Object API's addCallbackHandler and onMetaEvent methods. To remove only those handlers that have been added using the addOnMetaEvent or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onMetaEvent (null) to clear a handler that has been registered for the meta event using the onMetaEvent method has no effect on handlers that have been registered using the addOnMetaEvent or addCallbackHandler methods.

The clearOnOutputVolumeChange instance method lets you clear all handlers assigned to the output volume change event of a Music Object instance.
|
clearOnOutputVolumeChange ( ) |
The clearOnOutputVolumeChange method clears all handlers that have been added for the output volume change event using this extension's addOnOutputVolumeChange method, as well as the core Music Object API's addCallbackHandler and onOutputVolumeChange methods. To remove only those handlers that have been added using the addOnOutputVolumeChange or addCallbackHandler methods, use the variation of the removeOnOutputVolumeChange method that takes no parameters, as in the statement myMusicObject.removeOnOutputVolumeChange ( ). It should be noted that using the statement onOutputVolumeChange (null) to clear a handler that has been registered for the output volume change event using the onOutputVolumeChange method has no effect on handlers that have been registered using the addOnOutputVolumeChange or addCallbackHandler methods.

The clearOnPause instance method lets you clear all handlers assigned to the pause event of a Music Object instance.
|
clearOnPause ( ) |
The clearOnPause method clears all handlers that have been added for the pause event using this extension's addOnPause method, as well as the core Music Object API's addCallbackHandler and onPause methods. To remove only those handlers that have been added using the addOnPause or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onPause (null) to clear a handler that has been registered for the pause event using the onPause method has no effect on handlers that have been registered using the addOnPause or addCallbackHandler methods.

The clearOnPlay instance method lets you clear all handlers assigned to the play event of a Music Object instance.
|
clearOnPlay ( ) |
The clearOnPlay method clears all handlers that have been added for the play event using this extension's addOnPlay method, as well as the core Music Object API's addCallbackHandler and onPlay methods. To remove only those handlers that have been added using the addOnPlay or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onPlay (null) to clear a handler that has been registered for the play event using the onPlay method has no effect on handlers that have been registered using the addOnPlay or addCallbackHandler methods.

The clearOnReady instance method lets you clear all handlers assigned to the ready event of a Music Object instance.
|
clearOnReady ( ) |
The clearOnReady method clears all handlers that have been added for the ready event using this extension's addOnReady method, as well as the core Music Object API's addCallbackHandler and onReady methods. To remove only those handlers that have been added using the addOnReady or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onReady (null) to clear a handler that has been registered for the ready event using the onReady method has no effect on handlers that have been registered using the addOnReady or addCallbackHandler methods.

The clearOnStop instance method lets you clear all handlers assigned to the stop event of a Music Object instance.
|
clearOnStop ( ) |
The clearOnStop method clears all handlers that have been added for the stop event using this extension's addOnStop method, as well as the core Music Object API's addCallbackHandler and onStop methods. To remove only those handlers that have been added using the addOnStop or addCallbackHandler methods, use the variation of the removeOnPlay method that takes no parameters, as in the statement myMusicObject.removeOnPlay ( ). It should be noted that using the statement onStop (null) to clear a handler that has been registered for the stop event using the onStop method has no effect on handlers that have been registered using the addOnStop or addCallbackHandler methods.

The removeCallbackHandlers instance method lets you remove the specified callback handler (or handlers) from the specified instance callback type (or types).
The removeCallbackHandlers method lets you remove a specific callback handler from the stack of handlers that have been registered for the specified instance callback type. This is equivalent to using some of the other methods in this extension, such as removeOnLoad, removeOnMetaEvent, removeOnPause, removeOnPlay, removeOnReady, and removeOnStop. For instance, the statement myMusicObject.removeCallbackHandlers ('onPlay',myOnPlayHandler) is equivalent to the statement myMusicObject.removeOnPlay (myOnPlayHandler).
In order to successfully remove a specific handler using the removeCallbackHandlers method, one must correctly specify the callback type and the callback handler that were used when initially registering the callback handler. For example, in order the remove the handler registered using the statement myMusicObject.addCallbackHandler ('onPlay',myOnPlayHandler), one should use the statement myMusicObject.removeCallbackHandlers ('onPlay',myOnPlayHandler). In this example, using the statement myMusicObject.removeCallbackHandlers ('onPlay','myOnPlayHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
It is also possible to remove all handlers that have been added for a specific callback type by simply not specifying the handler to be removed, as in the example statement myMusicObject.removeCallbackHandlers ('onPlay'), which will remove all handlers that were added using the addOnPlay or addCallbackHandler methods. This is equivalent to the statement myMusicObject.removeOnPlay ().
Finally, one can remove all instance callback handlers that have been added using the methods in this extension by simply not specifying the instance callback type or handler, as in the statement myMusicObject.removeCallbackHandlers ().

- removeCallbackHandlers ( InstanceCallbackTypeSTR , HandlerJavaScriptSTR )
- removeCallbackHandlers ( InstanceCallbackTypeSTR )
When no handler is specified, all handlers that have been added (using the methods in this extension) for the specified callback type will be removed. For compatibility reasons, this does not affect handlers that have been registered using the core Music Object callback methods.
- removeCallbackHandlers ( )
When no callback type or handler is specified, all handlers that have been added using the methods in this extension will be removed - for all callback types. For compatibility reasons, this does not affect handlers that have been registered using the core Music Object callback methods.

The Music.removeCallbackHandlers static method lets you remove the specified callback handler (or handlers) from the specified static callback type (or types).
The Music.removeCallbackHandlers method lets you remove a specific callback handler from the stack of handlers that have been registered for the specified static callback type. This allows one to remove callback handlers from a static callback type where no dedicated static method has been provided for removing handlers from that callback. For example, while there is no static method provided for removing handlers from the onAudioEngagedChange static callback, one can remove handlers from this callback using the Music.removeCallbackHandlers method and specifying the string value "onAudioEngagedChange" for the StaticCallbackTypeSTR parameter.
In order to successfully remove a specific handler using the Music.removeCallbackHandlers method, one must correctly specify the callback type and the callback handler that were used when initially registering the callback handler. For example, in order the remove the handler registered using the statement Music.addCallbackHandler ('onAudioEngagedChange',myOnAudioEngagedChangeHandler), one should use the statement Music.removeCallbackHandlers ('onAudioEngagedChange',myOnAudioEngagedChangeHandler). In this example, using the statement myMusicObject.removeCallbackHandlers ('onAudioEngagedChange','myOnAudioEngagedChangeHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
It is also possible to remove all handlers that have been added for a specific callback type by simply not specifying the handler to be removed, as in the example statement Music.removeCallbackHandlers ('onAudioEngagedChange'), which will remove all handlers that were added to the onAudioEngagedChange static callback type.
Finally, one can remove all static callback handlers that have been added using the methods in this extension by simply not specifying the static callback type or handler, as in the statement Music.removeCallbackHandlers ().

- removeCallbackHandlers ( StaticCallbackTypeSTR , HandlerJavaScriptSTR )
- removeCallbackHandlers ( StaticCallbackTypeSTR )
When no handler is specified, all handlers that have been added (using the methods in this extension) for the specified callback type will be removed.
- removeCallbackHandlers ( )
When no callback type or handler is specified, all handlers that have been added using the methods in this extension will be removed - for all callback types.

The removeMetaEventHandlers instance method lets you remove one or more handlers for specific meta event type and value pairs.
The removeMetaEventHandlers method lets one remove a handler for a specific meta event that was added using the addMetaEventHandler method. To remove a handler for a specific meta event, one must correctly specify the meta event type, meta event value, and handler parameters that were used when originally registering the handler. For instance to remove a meta event handler that was added using the statement...
myMusicObject.addMetaEventHandler ('Marker','Fade to end',musicFadeOutBegins);
|
...one should use the statement...
myMusicObject.removeMetaEventHandlers ('Marker','Fade to end',musicFadeOutBegins);
|
It is possible to remove all handlers that are assigned to a specific meta event type / value by simply not specifying the handler, as in the statement myMusicObject.removeMetaEventHandlers ('Marker','Fade to end'). Furthermore, one can remove all handlers for a specific type of meta event, such as a "Marker" event, by not specifying the meta event value and handler parameters, as in the statement myMusicObject.removeMetaEventHandlers ('Marker'). Finally, one can remove all handlers for meta events that were added using the addMetaEventHandlers method by simply not specifying any parameters for this method, as in the statement myMusicObject.removeMetaEventHandlers ().

- removeMetaEventHandlers ( MetaEventTypeSTR , MetaEventValueSTR )
When no handler function is specified, all handlers that have been registered for the specified meta event type and value pair will be removed.
- removeMetaEventHandlers ( MetaEventTypeSTR )
When no MetaEventValueSTR parameter is specified, all handlers that have been registered for the specified meta event type will be removed.
- removeMetaEventHandlers ( )
When no handler is specified, all handlers that have been added using the addMetaEventHandler method will be removed. This does not affect other handlers that have been registered using the addOnMetaEvent or onMetaEvent methods.

The removeOnAudibleStateChange instance method lets you remove a specified handler from a Music Object instance's list of audible state change event handlers.
|
removeOnAudibleStateChange ( HandlerFunction ) |
The removeOnAudibleStateChange method lets one remove a specific handler that was added for the audible state change event using this extension's addOnAudibleStateChange method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the audible state change event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnAudibleStateChange (myOnAudibleStateChangeHandler), one should use the statement myMusicObject.removeOnAudibleStateChange (myOnAudibleStateChangeHandler). In this example, using the statement myMusicObject.removeOnAudibleStateChange ('myOnAudibleStateChangeHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the audible state change event using the core Music Object API's onAudibleStateChange method. Similarly, using the statement OnAudibleStateChange (null) to clear a handler that has been registered for the audible state change event using the onAudibleStateChange method has no effect on handlers that have been registered using the addOnAudibleStateChange or addCallbackHandler methods.

- removeOnAudibleStateChange ( HandlerJavaScriptSTR )
- removeOnAudibleStateChange ( )
When no handler is specified, all handlers that have been added using the addOnAudibleStateChange method will be removed. For backward compatibility reasons, the handler that has been registered using the onAudibleStateChange method is not affected.

The removeOnLoad instance method lets you remove a specified handler from a Music Object instance's list of load event handlers.
The removeOnLoad method lets one remove a specific handler that was added for the load event using this extension's addOnLoad method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the load event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnLoad (myOnLoadHandler), one should use the statement myMusicObject.removeOnLoad (myOnLoadHandler). In this example, using the statement myMusicObject.removeOnLoad ('myOnLoadHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the load event using the core Music Object API's onLoad method. Similarly, using the statement onLoad (null) to clear a handler that has been registered for the load event using the onLoad method has no effect on handlers that have been registered using the addOnLoad or addCallbackHandler methods.

- removeOnLoad ( HandlerJavaScriptSTR )
- removeOnLoad ( )
When no handler is specified, all handlers that have been added using the addOnLoad method will be removed. For backward compatibility reasons, the handler that has been registered using the onLoad method is not affected.

The removeOnMetaEvent instance method lets you remove a specified handler from a Music Object instance's list of meta event handlers.
The removeOnMetaEvent method lets one remove a specific handler that was added for the meta event using this extension's addOnMetaEvent method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the meta event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnMetaEvent (myOnMetaEventHandler), one should use the statement myMusicObject.removeOnMetaEvent (myOnMetaEventHandler). In this example, using the statement myMusicObject.removeOnMetaEvent ('myOnMetaEventHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the meta event using the core Music Object API's onMetaEvent method. Similarly, using the statement onMetaEvent (null) to clear a handler that has been registered for the meta event using the onMetaEvent method has no effect on handlers that have been registered using the addOnMetaEvent or addCallbackHandler methods.

- removeOnMetaEvent ( HandlerJavaScriptSTR )
- removeOnMetaEvent ( )
When no handler is specified, all handlers that have been added using the addOnMetaEvent method will be removed. For backward compatibility reasons, the handler that has been registered using the onMetaEvent method is not affected.

The removeOnOutputVolumeChange instance method lets you remove a specified handler from a Music Object instance's list of output volume change event handlers.
|
removeOnOutputVolumeChange ( HandlerFunction ) |
The removeOnOutputVolumeChange method lets one remove a specific handler that was added for the output volume change event using this extension's addOnOutputVolumeChange method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the output volume change event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnOutputVolumeChange (myOnOutputVolumeChangeHandler), one should use the statement myMusicObject.removeOnOutputVolumeChange (myOnOutputVolumeChangeHandler). In this example, using the statement myMusicObject.removeOnOutputVolumeChange ('myOnOutputVolumeChangeHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the output volume change event using the core Music Object API's onOutputVolumeChange method. Similarly, using the statement onOutputVolumeChange (null) to clear a handler that has been registered for the output volume change event using the onOutputVolumeChange method has no effect on handlers that have been registered using the addOnOutputVolumeChange or addCallbackHandler methods.

- removeOnOutputVolumeChange ( HandlerJavaScriptSTR )
- removeOnOutputVolumeChange ( )
When no handler is specified, all handlers that have been added using the addOnOutputVolumeChange method will be removed. For backward compatibility reasons, the handler that has been registered using the onOutputVolumeChange method is not affected.

The removeOnPause instance method lets you remove a specified handler from a Music Object instance's list of pause event handlers.
The removeOnPause method lets one remove a specific handler that was added for the pause event using this extension's addOnPause method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the pause event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnPause (myOnPauseHandler), one should use the statement myMusicObject.removeOnPause (myOnPauseHandler). In this example, using the statement myMusicObject.removeOnPause ('myOnPauseHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the pause event using the core Music Object API's onPause method. Similarly, using the statement onPause (null) to clear a handler that has been registered for the pause event using the onPause method has no effect on handlers that have been registered using the addOnPause or addCallbackHandler methods.

- removeOnPause ( HandlerJavaScriptSTR )
- removeOnPause ( )
When no handler is specified, all handlers that have been added using the addOnPause method will be removed. For backward compatibility reasons, the handler that has been registered using the onPause method is not affected.

The removeOnPlay instance method lets you remove a specified handler from a Music Object instance's list of play event handlers.
The removeOnPlay method lets one remove a specific handler that was added for the play event using this extension's addOnPlay method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the play event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnPlay (myOnPlayHandler), one should use the statement myMusicObject.removeOnPlay (myOnPlayHandler). In this example, using the statement myMusicObject.removeOnPlay ('myOnPlayHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the play event using the core Music Object API's onPlay method. Similarly, using the statement onPlay (null) to clear a handler that has been registered for the play event using the onPlay method has no effect on handlers that have been registered using the addOnPlay or addCallbackHandler methods.

- removeOnPlay ( HandlerJavaScriptSTR )
- removeOnPlay ( )
When no handler is specified, all handlers that have been added using the addOnPlay method will be removed. For backward compatibility reasons, the handler that has been registered using the onPlay method is not affected.

The removeOnReady instance method lets you remove a specified handler from a Music Object instance's list of ready event handlers.
The removeOnReady method lets one remove a specific handler that was added for the ready event using this extension's addOnReady method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the ready event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnReady (myOnReadyHandler), one should use the statement myMusicObject.removeOnReady (myOnReadyHandler). In this example, using the statement myMusicObject.removeOnReady ('myOnReadyHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the ready event using the core Music Object API's onReady method. Similarly, using the statement onReady (null) to clear a handler that has been registered for the ready event using the onReady method has no effect on handlers that have been registered using the addOnReady or addCallbackHandler methods.

- removeOnReady ( HandlerJavaScriptSTR )
- removeOnReady ( )
When no handler is specified, all handlers that have been added using the addOnReady method will be removed. For backward compatibility reasons, the handler that has been registered using the onReady method is not affected.

The removeOnStop instance method lets you remove a specified handler from a Music Object instance's list of stop event handlers.
The removeOnStop method lets one remove a specific handler that was added for the stop event using this extension's addOnStop method or the core Music Object API's addCallbackHandler method.
In order to successfully remove a handler for the stop event that has been added using the methods in this extension, one must correctly specify the handler that was used when originally registering the handler. For instance, in order to remove a handler that was added using the statement myMusicObject.addOnStop (myOnStopHandler), one should use the statement myMusicObject.removeOnStop (myOnStopHandler). In this example, using the statement myMusicObject.removeOnStop ('myOnStopHandler ()') would be incorrect and would not remove the handler, since the original statement that registered the callback handler registered it using the Function type to specify the handler, and not the String type.
For backward compatibility reasons, this method does not affect a handler that has been registered for the stop event using the core Music Object API's onStop method. Similarly, using the statement onStop (null) to clear a handler that has been registered for the stop event using the onStop method has no effect on handlers that have been registered using the addOnStop or addCallbackHandler methods.

- removeOnStop ( HandlerJavaScriptSTR )
- removeOnStop ( )
When no handler is specified, all handlers that have been added using the addOnStop method will be removed. For backward compatibility reasons, the handler that has been registered using the onStop method is not affected.
